@filigran/chatbot 3.15.1 → 3.16.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -8,7 +8,44 @@ the versions follow [semantic versioning](https://semver.org/spec/v2.0.0.html).
8
8
  This file starts at 3.10.0; earlier releases are on the
9
9
  [releases page](https://github.com/FiligranHQ/filigran-ui/releases).
10
10
 
11
- ## 3.15.1 — unreleased
11
+ ## 3.16.0 — unreleased
12
+
13
+ ### Added
14
+
15
+ - `theme`: the host's colours, type and shapes (surfaces, menus, subtle and
16
+ hover fills, text fields, text, secondary and muted text, borders, a user's message, an
17
+ answer's text size, code), set as `--filigran-chat-*` variables on the panel
18
+ root. Every entry left out keeps the panel's own look, light and dark, so a
19
+ host that sets nothing sees the same panel (#460).
20
+
21
+ ### Fixed
22
+
23
+ - In dark mode, the hover and focus colours an element carries show as they do
24
+ in light mode (an accent border on hover, the composer's focus border); its
25
+ dark colour used to hide them (#460).
26
+
27
+ ## 3.15.2 — 2026-10-28
28
+
29
+ ### Fixed
30
+
31
+ - The thread keeps the end of the conversation in view when what an answer
32
+ carries takes its height after the answer rendered (an image, a chart, a file
33
+ card): it used to stop short of it (#460).
34
+ - A message sent while the agent writes its answer shows above that answer,
35
+ where the backend stores it, instead of below it with the rest of the answer
36
+ streaming in above; the same for a message of another tab relayed during a
37
+ relayed answer (#460).
38
+ - A turn whose stream drops is awaited for as long as the event stream takes
39
+ to reopen (a backend restart), showing "Reconnecting…", instead of being
40
+ marked stopped 15 s after the drop; an `error` or `cancelled` of the event
41
+ stream naming it ends it at once, and one that ended out of sight is
42
+ answered or stopped as the history read back says (#460).
43
+ - A stream its server keeps alive (comments at a keep-alive cadence) that then
44
+ falls silent for 45 s is taken for dropped, so a stream a proxy left
45
+ half-open is handed over instead of hanging, when the event stream can pick
46
+ its turn up (#460).
47
+
48
+ ## 3.15.1 — 2026-10-27
12
49
 
13
50
  ### Fixed
14
51
 
package/README.md CHANGED
@@ -121,6 +121,7 @@ import { ChatPanel } from '@filigran/chatbot';
121
121
  | `waitingMessages` | `string[]` | built-in | The waiting panel's rotating messages, already translated |
122
122
  | `renderWaitingPanel` | `() => React.ReactNode` | — | Replaces the waiting panel's content (its messages and the invitation to play) |
123
123
  | `fontFamily` | `string` | — | Font of the panel's text |
124
+ | `theme` | `ChatPanelTheme` | — | The host's colours, type and shapes; see [Custom Theme](#custom-theme) |
124
125
  | `agentMentions` | `boolean` | `false` | `@` also mentions agents of the agent list; the message carries their ids as `mentioned_agent_ids` |
125
126
  | `steerAttachments` | `boolean` | `false` | Uploaded files may steer the running turn (the steer route takes `file_ids`) |
126
127
  | `onReady` | `() => void` | — | Called once, when the panel has chosen its agent and read back the conversation on screen; handle calls made earlier wait for it and then run in order |
@@ -1058,8 +1059,18 @@ never relay a panel's own turn back to it; frames naming the `turn_id` of the
1058
1059
  panel's own turn are dropped too. When the panel's own stream drops mid-turn,
1059
1060
  or ends without the turn's last frame (`done`, `error`, `session_expired` or
1060
1061
  `cancelled`), it takes a new id and picks the turn up from the event stream,
1061
- keeping the segments it closed (or reads the history back when nothing comes
1062
- within 15 s). A read-back that waited for a turn to end joins the thread in
1062
+ keeping the segments it closed. It shows "Reconnecting…" for as long as the
1063
+ event stream takes to reopen (a backend restarting, up to 15 minutes), then
1064
+ waits 5 s for the snapshot to replay the turn; an `error` or `cancelled` of
1065
+ the event stream naming that turn ends it as a relayed turn's end would, and
1066
+ with nothing in time the turn ended out of sight, answered or stopped as the
1067
+ history read back says. When the event stream cannot open (no conversation
1068
+ to follow yet) or answers an error other than a gateway's (502, 503, 504),
1069
+ the turn is not awaited that long. A stream whose `: keepalive` comments came
1070
+ at a keep-alive cadence and that then sends nothing for 45 s (a proxy that left
1071
+ it half-open) is taken for dropped the same way, when the event stream can
1072
+ pick its turn up; a backend without one keeps a silent stream open, as before. A message sent while a turn writes its answer shows above that
1073
+ answer, where the backend stores it. A read-back that waited for a turn to end joins the thread in
1063
1074
  place: each stored message missing from the screen goes after the one stored
1064
1075
  before it, so nothing lands above messages it follows.
1065
1076
 
@@ -1201,6 +1212,44 @@ import { MyLogo } from './icons';
1201
1212
  />
1202
1213
  ```
1203
1214
 
1215
+ ### Custom Theme
1216
+
1217
+ `theme` gives the panel the host's design system. Each entry is a CSS value
1218
+ and sets the `--filigran-chat-*` variable named beside it on the panel root,
1219
+ where everything the panel renders (its dialogs and menus included) reads it;
1220
+ an entry left out keeps the panel's own look, light and dark. A host's own
1221
+ variables (`var(--x)`) follow its light and dark modes, so one value serves
1222
+ both. The same variables may be set in CSS on an ancestor instead.
1223
+
1224
+ | Entry | Variable | Styles |
1225
+ | ------------------ | ----------------------------------- | ------ |
1226
+ | `surface` | `--filigran-chat-surface` | The background inline and fullscreen |
1227
+ | `surfaceRaised` | `--filigran-chat-surface-raised` | The background as a sidebar or floating card, and of its dialogs and menus |
1228
+ | `surfaceSubtle` | `--filigran-chat-surface-subtle` | Cards, search boxes, a table's or a code block's header |
1229
+ | `surfaceHover` | `--filigran-chat-surface-hover` | A row or a button under the pointer |
1230
+ | `inputSurface` | `--filigran-chat-input-surface` | A text field: the composer (no fill unless set), a rename field, the feedback and approval comments |
1231
+ | `headerBackground` | `--filigran-chat-header-background` | The header's background, a colour or an image (`none` for the surface alone) |
1232
+ | `text` | `--filigran-chat-text` | Text |
1233
+ | `textMuted` | `--filigran-chat-text-muted` | Times, labels, hints and placeholders |
1234
+ | `textSecondary` | `--filigran-chat-text-secondary` | Table cells, chips, descriptions, notices |
1235
+ | `border` | `--filigran-chat-border` | Dividers, outlines, a gauge's track and the loading skeleton |
1236
+ | `textSize` | `--filigran-chat-text-size` | An answer's prose, its headings in proportion, and a user's message unless `userTextSize` |
1237
+ | `userBackground`, `userText`, `userRadius`, `userPadding`, `userTextSize` | `--filigran-chat-user-*` | A user's message |
1238
+ | `fontMono`, `codeSize`, `codeSurface` | `--filigran-chat-font-mono`, `-code-size`, `-code-surface` | Code, in a block or inline |
1239
+
1240
+ ```tsx
1241
+ <ChatPanel
1242
+ theme={{
1243
+ surface: 'var(--page-background)',
1244
+ text: 'var(--text-primary)',
1245
+ userBackground: 'color-mix(in oklab, var(--accent) 10%, transparent)',
1246
+ userText: 'var(--text-primary)',
1247
+ textSize: '1rem',
1248
+ }}
1249
+ // ...
1250
+ />
1251
+ ```
1252
+
1204
1253
  ### Custom Prompt Suggestions
1205
1254
 
1206
1255
  ```tsx
package/dist/index.d.ts CHANGED
@@ -374,6 +374,44 @@ interface ChatContextBreakdown {
374
374
  /** Output of tool calls still held verbatim in the context. */
375
375
  toolResults?: number;
376
376
  }
377
+ /**
378
+ * What a host's design system sets on the panel (`ChatPanelProps.theme`):
379
+ * CSS values, each the `--filigran-chat-*` variable named beside it.
380
+ */
381
+ interface ChatPanelTheme {
382
+ /** The panel's background inline and fullscreen (`--filigran-chat-surface`). */
383
+ surface?: string;
384
+ /** The panel's background as a sidebar or floating card, and its dialogs' (`--filigran-chat-surface-raised`). */
385
+ surfaceRaised?: string;
386
+ /** Cards, search boxes, a table's or a code block's header: a shade off the surface (`--filigran-chat-surface-subtle`). */
387
+ surfaceSubtle?: string;
388
+ /** A row or a button under the pointer (`--filigran-chat-surface-hover`). */
389
+ surfaceHover?: string;
390
+ /** A text field: the composer (no fill unless set), a rename field, the feedback and approval comments (`--filigran-chat-input-surface`). */
391
+ inputSurface?: string;
392
+ /** The header's background, a colour or an image; `none` for the surface alone (`--filigran-chat-header-background`). */
393
+ headerBackground?: string;
394
+ /** Text (`--filigran-chat-text`). */
395
+ text?: string;
396
+ /** Faint text: times, labels, hints, placeholders (`--filigran-chat-text-muted`). */
397
+ textMuted?: string;
398
+ /** Secondary text: table cells, chips, descriptions, notices (`--filigran-chat-text-secondary`). */
399
+ textSecondary?: string;
400
+ /** Dividers, outlines, a gauge's track and the loading skeleton (`--filigran-chat-border`). */
401
+ border?: string;
402
+ /** The size of an answer's prose, its headings in proportion, and of a user's message unless `userTextSize` (`--filigran-chat-text-size`). */
403
+ textSize?: string;
404
+ /** A user's message: background, text, corners, padding and size (`--filigran-chat-user-*`). */
405
+ userBackground?: string;
406
+ userText?: string;
407
+ userRadius?: string;
408
+ userPadding?: string;
409
+ userTextSize?: string;
410
+ /** Code: its font, size and background (`--filigran-chat-font-mono`, `-code-size`, `-code-surface`). */
411
+ fontMono?: string;
412
+ codeSize?: string;
413
+ codeSurface?: string;
414
+ }
377
415
  interface ChatPanelProps {
378
416
  mode: ChatPanelMode;
379
417
  /** Shows the close button; inline mode has none. */
@@ -636,6 +674,13 @@ interface ChatPanelProps {
636
674
  renderWaitingPanel?: () => React.ReactNode;
637
675
  /** Font of the panel's text; the package's own otherwise. */
638
676
  fontFamily?: string;
677
+ /**
678
+ * The host's colours, type and shapes, as CSS values (a host's own
679
+ * variables, `var(--x)`, follow its light and dark modes); each one unset
680
+ * keeps the panel's own. The same `--filigran-chat-*` variables can be set
681
+ * in CSS on an ancestor instead.
682
+ */
683
+ theme?: ChatPanelTheme;
639
684
  /**
640
685
  * Called once, when the panel has chosen its agent and read back the
641
686
  * conversation on screen. Calls made through the handle before then wait
@@ -1150,4 +1195,4 @@ interface TransferredAgent {
1150
1195
  declare const voiceCallSupported: () => boolean;
1151
1196
 
1152
1197
  export { ChatPanel, ChatToggleButton, voiceCallSupported };
1153
- export type { AgentStatusState, ApiEndpoints, BackendType, ChatAnsweredBy, ChatArtifact, ChatArtifactKind, ChatAttachment, ChatCodeBlockContext, ChatCodeBlockRenderer, ChatContextBreakdown, ChatContextUsage, ChatConversationRef, ChatConversationReferenceCandidate, ChatConversationSummary, ChatFile, ChatHeldOutcome, ChatMarkerContext, ChatMarkerRenderer, ChatMessage, ChatMessagePersistedFeedback, ChatMessageSlotContext, ChatMode, ChatPanelHandle, ChatPanelMode, ChatPanelProps, ChatPromptTemplate, ChatQuotaStatus, ChatSendDecision, ChatSendDraft, ChatSendOptions, ChatSendOutcome, ChatStreamEventInfo, ChatToggleButtonProps, ChatTurnEnd, ChatTurnOutcome, ChatWorkspace, MessageFeedback, ToolApprovalDecision, ToolApprovalProposal, ToolApprovalVerdict, TransferredAgent, Translate, XtmAgent };
1198
+ export type { AgentStatusState, ApiEndpoints, BackendType, ChatAnsweredBy, ChatArtifact, ChatArtifactKind, ChatAttachment, ChatCodeBlockContext, ChatCodeBlockRenderer, ChatContextBreakdown, ChatContextUsage, ChatConversationRef, ChatConversationReferenceCandidate, ChatConversationSummary, ChatFile, ChatHeldOutcome, ChatMarkerContext, ChatMarkerRenderer, ChatMessage, ChatMessagePersistedFeedback, ChatMessageSlotContext, ChatMode, ChatPanelHandle, ChatPanelMode, ChatPanelProps, ChatPanelTheme, ChatPromptTemplate, ChatQuotaStatus, ChatSendDecision, ChatSendDraft, ChatSendOptions, ChatSendOutcome, ChatStreamEventInfo, ChatToggleButtonProps, ChatTurnEnd, ChatTurnOutcome, ChatWorkspace, MessageFeedback, ToolApprovalDecision, ToolApprovalProposal, ToolApprovalVerdict, TransferredAgent, Translate, XtmAgent };